package week3;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;

public class 日期计算 {
	public static void main(String[] args) {
		
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
		
		LocalDate date1 = LocalDate.parse("20110412", formatter);
		LocalDate date2 = LocalDate.parse("20110422", formatter);
		
		long difference = ChronoUnit.DAYS.between(date1, date2);
		
		System.out.println(Math.abs(difference) + 1);
		
	}
}
